<template>
  <van-row>
    <div class="top"></div>
    <div v-for="(item,index) in paperList" :key="index" style="margin-bottom: 20px">
      <van-panel :title="item.title"  status="已完成">
        <div style="background-color: #fcfcfc;padding-bottom: 20px;padding-top: 20px">
           <div class="time" style="display: inline-block;width: 25%;padding-left: 50px"><span style="color: darkgreen">答题日期:</span>{{item.content.date}}</div>
          <div class="date" style="display: inline-block;width: 25%"><span style="color: darkgreen">用时:</span>{{item.content.time}}分钟</div>
          <div class="grade" style="display: inline-block"><span style="color: red">成绩为:</span>{{item.content.grade}}</div>
        </div>
      </van-panel>
    </div>
    <div class="bottom"></div>
  </van-row>
</template>

<script>
  import {baseUrl} from '../constants'

  export default {
  name: 'datas',
  data () {
    return {
      paperList:[],
      user:{},
      userID:'',
      paperKey:'',
      questions:[],
    }
  },
    mounted(){
      this.user=this.$store.state.user;
      this.userID=this.user.id;
      if(this.userID){
        this.axios.get(baseUrl.serverUrl+'/user/answer?id='+this.userID).then(res=>{
          if(res.data.status==1){
            //获取测试记录
            this.paperList=res.data.data;
            this.paperList.forEach(data=>{
              data.content=JSON.parse(data.content);
            })

          }
        })
      }
    },
  methods: {

  }
}
</script>

<style scoped>
</style>
